package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the pur_return database table.
 * 
 */
@Entity
@Table(name="pur_return")
@NamedQuery(name="PurReturn.findAll", query="SELECT p FROM PurReturn p")
public class PurReturn implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="return_id")
	private String returnId;

	private String remarks;

	@Temporal(TemporalType.DATE)
	private Date returndate;

	private String sourceid;

	private String state;

	private String supplier;

	//bi-directional many-to-one association to PurReturnDetail
	@OneToMany(mappedBy="purReturn")
	private List<PurReturnDetail> purReturnDetails;

	public PurReturn() {
	}

	public String getReturnId() {
		return this.returnId;
	}

	public void setReturnId(String returnId) {
		this.returnId = returnId;
	}

	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public Date getReturndate() {
		return this.returndate;
	}

	public void setReturndate(Date returndate) {
		this.returndate = returndate;
	}

	public String getSourceid() {
		return this.sourceid;
	}

	public void setSourceid(String sourceid) {
		this.sourceid = sourceid;
	}

	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getSupplier() {
		return this.supplier;
	}

	public void setSupplier(String supplier) {
		this.supplier = supplier;
	}

	public List<PurReturnDetail> getPurReturnDetails() {
		return this.purReturnDetails;
	}

	public void setPurReturnDetails(List<PurReturnDetail> purReturnDetails) {
		this.purReturnDetails = purReturnDetails;
	}

	public PurReturnDetail addPurReturnDetail(PurReturnDetail purReturnDetail) {
		getPurReturnDetails().add(purReturnDetail);
		purReturnDetail.setPurReturn(this);

		return purReturnDetail;
	}

	public PurReturnDetail removePurReturnDetail(PurReturnDetail purReturnDetail) {
		getPurReturnDetails().remove(purReturnDetail);
		purReturnDetail.setPurReturn(null);

		return purReturnDetail;
	}

}